<div v-show="show" id="alert">
    <div class="weui-mask"></div>
    <div class="weui-dialog">
        <div class="weui-dialog__hd"><strong class="weui-dialog__title">@{{ title }}</strong></div>
        <div class="weui-dialog__bd" v-html="msg"></div>
        <div class="weui-dialog__ft">
            <a href="javascript:;" @click="show = false" class="weui-dialog__btn weui-dialog__btn_primary">确定</a>
        </div>
    </div>
</div>

<script>
    var alertComponent = new Vue({
        el: '#alert' ,
        data: {
            show: false,
            title: '',
            msg: ''
        },
        methods: {
            showAlert: function(title, msg){
                this.title = title;
                this.msg = msg;
                this.show = true;
            }
        }
    });
</script>